Previous Book Contents Book Index Next

Inside Macintosh: 3D Graphics Programming With QuickDraw 3D /
Chapter 16 - Storage Objects / Storage Objects Reference
Storage Objects Routines / Creating and Accessing Memory Storage Objects


Q3MemoryStorage_GetBuffer

You can use the Q3MemoryStorage_GetBuffer function to get the data of a memory storage object.

TQ3Status Q3MemoryStorage_GetBuffer (
TQ3StorageObject storage, 
unsigned char **buffer, 
unsigned long *validSize, 
unsigned long *bufferSize);
storage
A memory storage object.
buffer
On entry, a pointer to a pointer. On exit, a pointer to a pointer to the block of memory associated with the specified storage object.
validSize
On exit, the size, in bytes, of the valid metafile data contained in the specified buffer.
bufferSize
On exit, the size, in bytes, of the block of memory whose address is returned through the buffer parameter.
DESCRIPTION
The Q3MemoryStorage_GetBuffer function returns, in the buffer and bufferSize parameters, the address and size of the block of memory currently associated with the memory storage object specified by the storage parameter. Note that the returned address is the address of the storage object's data, not of a copy of that data. As a result, the returned pointer may become a dangling pointer if the buffer holding the storage object's data is dynamically reallocated (perhaps because additional data was written to the object).

ERRORS
kQ3ErrorAccessRestricted
kQ3ErrorInvalidObjectParameter


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996